<?

require("../include/functions.inc");
//die($new_email);
openConnection();
$sql = "select id from pismo where email='$new_email'";
$res = mysql_query ($sql)
     or die("No update. Try again sunser!");
     if(mysql_num_rows($res) != 0){
       header("Location: lista.php?confirmation=false");
       exit;
     } else {
       $sql2 ="insert into pismo (id, email) values ('', '".$new_email."')"; 
       $res2 = mysql_query ($sql2);
       header("Location: lista.php?confirmation=true");
       exit; 
     }
?>